package heartbeat

import (
	"core/config"
	"fmt"
	"time"
)

type HeartbeatMessage struct {
	Name string    `json:"name"`
	URL  []string  `json:"url"`
	Now  time.Time `json:"now"`
}

func PushHeartbeat() {
	fmt.Println(config.CurrentModule.Hosts)
}

// 定时任务
func Heartbeat() {
	ticker := time.NewTicker(time.Second * time.Duration(config.Config.Heartbeat.Interval))
	for {
		select {
		case <-ticker.C:
			PushHeartbeat()
		}
	}
}
